package edu.xmut.singleton.lazy;

/**
 * @author 朔风
 * @date 2024-02-17 12:41
 */
public class SingletonTest06 {
    public static void main(String[] args) {
        SingletonEnum instance1 = SingletonEnum.getInstance();
        SingletonEnum instance2 = SingletonEnum.getInstance();
        System.out.println(instance1 == instance2);
        System.out.println(instance1.hashCode());
        System.out.println(instance2.hashCode());
    }
}

enum SingletonEnum {
    INSTANCE;

    public static SingletonEnum getInstance() {
        return INSTANCE;
    }
}
